exports.search_info = (req, res) => {

  var resultData = {};

  var restfulParams = req.routeInfo.restfulParams;

  //查询要审批的申请列表
  function searchProcessFlow(cb){

    R.SEND_HTTP(
      req,
      res,
      {
        url: CORE_APIConfig.coreAPI.processFlowSearch.Request_Api_Url + "/count/1/opf_operator_id/" + restfulParams.opf_operator_id + "/opf_state/1/opf_is_delete/0/skip/"+restfulParams.skip+"/limit/"+restfulParams.limit,
        method: 'POST',
        data: {
          
        }
      },
      function (data) {

        resultData.processFlowData = data.result.data
        resultData.count = data.result.count

        cb();

      }
    )
  }

  //根据审批列表查询申请相关信息
  function searchApplyInfo(cb){

    F.SerialEach(resultData.processFlowData,function(item,index,callback){

      R.SEND_HTTP(
        req,
        res,
        {
            url: CORE_APIConfig.coreAPI.applyProcessSearchInfo.Request_Api_Url + "/oap_id/" + item.opf_oapid,
            method : 'POST',
            data : {
              fields : [
                "oap_id",
                "oap_uid",
                "oap_process",
                "oap_create_time",
                "oap_status",
                "oap_content",
                "of_id",
                "of_name",
                "of_create_time",
                "of_is_used",
                "of_note",
                "of_uid",
                "u_id",
                "u_nickname"
              ].join(",")
            }
        },
        function (data) {        
           
            item.of_name = data.result.data[0].of_name;
            item.oap_status = data.result.data[0].oap_status;
            item.oap_content = data.result.data[0].oap_content;
            item.oap_create_time = data.result.data[0].oap_create_time;
            item.oap_uid = data.result.data[0].oap_uid;
            item.u_nickname = data.result.data[0].u_nickname;

            callback();

        }
      )


    },cb)

  }


  F.Serial([searchProcessFlow,searchApplyInfo], () => {

    //将最终结果返回给客户端
    RES.successResponse(res, resultData);

  })


}